<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of maskGaussians</title>
  <meta name="keywords" content="maskGaussians">
  <meta name="description" content="Divides a volume into softly overlapping gaussian windows.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html images -->
<h1>maskGaussians
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Divides a volume into softly overlapping gaussian windows.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [masks,keepLocs] = maskGaussians( siz, M, width, offset, show ) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Divides a volume into softly overlapping gaussian windows.

 Return M^nd masks each of size siz.  Each mask represents a symmetric
 gaussian window, the locations are evenly spaced throughout the array of
 size siz.  For example, if M=2, then along each dimension d the location
 of each mask is either 1/4 or 3/4 of siz(d) and likewise if M=3 that mask
 is at 1/6,3/6, or 5/6 of siz(d). For higher M the locations are:
 1/2M,3/2M,...,M-1/2M. See examples below to visualize the masks.

 The std of each gaussian is set to be equal to the spacing between two
 adjacent masks multiplied by width.  Reducing the widths of the gaussians
 causes there to be less overlap between masks, but if the width is
 reduced too far certain pixels in between masks receive very little
 weight.  A desired property of the masks is that their coverage (the
 total weight placed on the pixel by all the masks) is approximately
 constant.  Typically, we settle for having the coverage be monotonically
 decreasing as we move away from the center.  (In reality the coverage
 oscilates as we move past peaks, it's just that the oscillations tend to
 be small).  The default value of the width is .6, which minimizes overlap
 while still providing good overall coverage. Values lower tend to produce
 noticeable oscillations in coverage.  offset in (-.5,1) controls the
 spacing of the locations.  Essentially, a positive offset moves the
 locations away from the center of the array and a negative offset moves
 the windows away from the center.  Using a positive offset gives better
 coverage to areas near the borders.

 USAGE
  [masks,keepLocs] = maskGaussians( siz, M, [width], [offset], [show] )
 
 INPUTS
  siz         - dimensions of each mask
  M           - # mask locations along each dim [either scalar or vector]
  width       - [.6] widths of the gaussians
  offset      - [.1] spacing of mask centers; in (-.5,1)
  [show]      - [0] figure to use for display (no display if==0) (nd&lt;=3)

 OUTPUTS
  masks       - [see above] array of size [siz x M^nd]
  keepLocs    - logical array of all locs where masks is nonzero

 EXAMPLE
  masks = maskGaussians( 100, 10, .6, -.1, 1 );  %1D
  masks = maskGaussians( [35 35], 3, .6, .1, 1 );  %2D
  masks = maskGaussians( [35 35 35], [2 2 4], .6, .1, 1 ); %3D

 See also <a href="histcImLoc.html" class="code" title="function h = histcImLoc( I, edges, parMask, wtMask, multCh )">HISTCIMLOC</a>, <a href="maskCircle.html" class="code" title="function mask = maskCircle( angleStart, angleSiz, r, nSamples )">MASKCIRCLE</a>

 Piotr's Computer Vision Matlab Toolbox      Version 2.0
 Copyright 2014 Piotr Dollar.  [pdollar-at-gmail.com]
 Licensed under the Simplified BSD License [see external/bsd.txt]</pre></div>





<!-- Start of Google Analytics Code -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4884268-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- end of Google Analytics Code -->

<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>
